package com.goldcn.enumeration;

/**
 * Created by Administrator on 2016/8/24.
 */
public enum ErrorCodeEnum {
    queryMemberDataFail("100003", "查询销售经理数据失败"),
    queryBranchFail("100002", "查询分部数据失败"),
    queryDataFail("100001", "查询数据失败"),
    lableIsUsed("106", "标签正在使用，无法删除"),
    updateCommissionFailure("101", "修改扣点失败"),
    deleteLabelFailure("102", "删除标签失败"),
    addLabelFailure("103", "增加标签失败"),
    updateLabelFailure("104", "修改标签失败"),



    addLabelReanem("105", "标签名重复"),
    addPicinfoFailure("106", "操作图片信息失败"),
    updateSysFailure("107", "图片系统标签操作失败"),
    delSysFailure("108", "图片系统标签删除操作失败"),


    goodsNoLabel("015", "请先选择标签"),
    updateGoodsCartError("014", "更新购物车出错"),
    RemoteGetSupplierInfoFailure("013", "获取入驻商信息失败"),
    operateGoodsIndexingFailure("012", "操作索引出错"),
    orderException("011", "订单失效或异常"),
    synchronizationInventoryFailure("010", "同步库存失败"),
    notifyShoppingCartFailure("009", "通知购物车下架商品失败"),
    goodsInventoryShortage("008", "库存不足"),
    goodsParmsError("007", "状态参数错误"),
    queryGoodsDetailFailure("006", "查询商品详情失败"),
    goodsNoExist("005", "商品不存在"),
    shopNoExist("015", "店铺不存在"),
    operateGoodsInfoFailure("004", "更新商品信息出错"),
    operateOtherExceptionFailure("003", "操作商品出错"),
    goodsSkuNoInventory("002", "库存不足"),//库存不足
    goodsImageError("001", "更新商品图片出错"),
    orderBorrowNoExist("205", "借货订单不存在"),
    orderBorrowStateError("201", "订单该状态不能执行此操作"),
    orderBorrowAuditException("304", "该审核未能执行"),
    noSettingOrderBorrowAuditLevel("305", "未获取到借货审核级别设置"),
    goodsTagError("306", "更新商品标签出错"),

    borrowToERPFailure("601", "借货订单同步ERP信息失败"),
    borrowToERPNofoundException("602", "未查到该借货订单信息"),
    borrowToERPReceiptFailure("603", "借货确认收货同步ERP失败"),
    borrowToERPStateException("604", "借货订单该状态未能执行此操作"),
    borrowToERPUpFailure("605", "操作失败"),

    addEnshrineFailure("4001","已经收藏该图片"),

    auditStorageFailure("4002","该记录已经审核过"),
    operatorPicinfoFailure("4003","不是产品实物图，无权操作"),


    addSpecialFailure("701", "增加专题失败"),
    updateSpecialFailure("702", "修改专题失败"),
    deleteSpecialFailure("703", "删除专题失败"),
    addSpecialDetailFailure("701", "增加专题图片失败"),
    shopGoodsOnsale("8001", "店铺商品已上架");






    private String errorCode;

    private String errorMsg;

    ErrorCodeEnum(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public static ErrorCodeEnum stateOf(String index) {
        for (ErrorCodeEnum errorCodeEnum : values()) {
            if (errorCodeEnum.getErrorCode().equals(index)) {
                return errorCodeEnum;
            }
        }
        return null;
    }


}
